package com.yequan.thread.threadpool;

/**
 * @author yq
 * @date 2020/07/27
 */
public class Test {

    public static void main(String[] args) {
        ThreadPoolManagerEasy threadPool = ThreadPoolManagerEasy.newInstance();
        for (int i = 0; i < 50; i++) {
            int count = i;
            threadPool.addExecuteTask(() -> {
                try {
                    System.out.println("任务执行：" + count);
                    Thread.sleep(500);
                    System.err.println("core size: " + threadPool.mThreadPool.getCorePoolSize());
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            });
        }
    }

}
